package org.etlt.check;

import org.etlt.SettingCheck;

import java.util.ArrayList;
import java.util.List;

public class CheckListSetting implements SettingCheck {
    private String name;

    private ReportType reportType;

    private List<CheckPointSetting> checkPointSettings = new ArrayList<>();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ReportType getReportType() {
        return reportType;
    }

    public void setReportType(ReportType reportType) {
        this.reportType = reportType;
    }

    public void addCheckPointSetting(CheckPointSetting checkPointSetting){
        if(checkPointSettings.contains(checkPointSetting))
            throw new IllegalStateException("Duplication check point setting found: " + checkPointSetting.getName());
        this.checkPointSettings.add(checkPointSetting);
    }

    public List<CheckPointSetting> getCheckPointSettings() {
        return checkPointSettings;
    }

    @Override
    public void check() {
        this.assertName("name", this.name);
    }
}
